package com.player.thirdGroup.service;

import com.player.thirdGroup.dao.LogDao;
import com.player.thirdGroup.entity.Dept;
import com.player.thirdGroup.entity.Log;
import com.player.thirdGroup.util.BootStrapTablePage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;

import javax.xml.ws.Action;
import java.util.List;

/**
 * @author VULCAN
 * @create 2019-12-28 7:48
 * @desc 日志
 **/
@Service
public class LogService {
    @Autowired
    private LogDao logDao;
    //分页列表
    public Page<Log> findAll(BootStrapTablePage page){
        PageRequest of = PageRequest.of(page.getPage() - 1, page.getLimit());
        Page<Log> all = logDao.findAll(of);
        return all;
    }

    public List<Log> findAllLog() {
        return logDao.findAll();
    }
}
